package com.haredot.vo;


import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * 接收 添加/修改 功能参数
 */
public class FuncVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 7464584358608642851L;
    private Long id;
    /**
     * 功能名
     */
    @NotEmpty(message = "功能名不允许为空")
    @Length(max = 100, message = "功能名过长")
    private String funcName;

    /**
     * 排序值
     */
    @NotNull(message = "排序值不允许为空")
    private Integer sorted;

    /**
     * 路由地址
     */
    @NotEmpty(message = "路由地址不允许为空")
    @Pattern(regexp = "^\\/.*?$" , message = "路由地址必须以\"斜杠\"开头")
    private String url;

    /**
     * 权限标记
     */
    @NotEmpty(message = "权限标识不允许为空")
    @Pattern(regexp = "^\\w+(:\\w+)*$" , message = "权限标识格式不正确")
    private String remark;

    /**
     * 系统状态
     */
    @NotNull(message = "状态不能为空")
    private Boolean state;
    /**
     * 菜单ID
     */
    @NotNull(message = "菜单不能为空")
    @Size(min = 1, message = "菜单必须至少选择一个")
    private List<Long> menus;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getFuncName() {
        return funcName;
    }

    public void setFuncName(String funcName) {
        this.funcName = funcName;
    }

    public Integer getSorted() {
        return sorted;
    }

    public void setSorted(Integer sorted) {
        this.sorted = sorted;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Boolean getState() {
        return state;
    }

    public void setState(Boolean state) {
        this.state = state;
    }

    public List<Long> getMenus() {
        return menus;
    }

    public void setMenus(List<Long> menus) {
        this.menus = menus;
    }
}
